package com.woniuxy.dao;

import com.woniuxy.controller.form.SetAccountForm;
import com.woniuxy.dao.model.Account;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;


/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Keep it simple
 * @since 2022-06-28
 */
public interface AccountDao extends BaseMapper<Account> {


    /**
     * 账号激活
     * @param activeCode
     */
    @Update("update account set account_state=1 where account_activation=#{activeCode}")
    void activation(String activeCode);

    /**
     * 修改信息
     * @param accountForm
     * @return
     */
    @Update("update account set account_name=#{accountForm.accountName},account_phone=#{accountForm.accountPhone},account_email=#{accountForm.accountEmail},account_touxin=#{accountForm.accountTouxin} WHERE account=#{account}")
    Integer setAccount(@Param("accountForm") SetAccountForm accountForm,@Param("account") String account);
}
